To sort data and gain more experience in the SQL Wizard all while creating an employee photo directory.
Assuming you’ve completed the previous tutorial and have a new employee photo directory in the works, you might be wondering “well, this is great and all, but aren’t directories supposed to be sorted by last name or something?” And you are exactly right!! Now we need to figure out how to sort using the SQL Wizard.
This tutorial is a continuation of the SQL - Part 1: Basic Selection tutorial. We will start off with the template as it is at the end of that tutorial, so if you haven’t already, you should check that tutorial out (it won’t take very long)!
As with the previous tutorial, we need to open the SQL Wizard again. Do this by selecting the ForEach tag [forEach Employee: and clicking the Wizard button in the AutoTag ribbon.
We want to sort the tutorial first by last name, and then in the case of two people with the same last name (which there won’t be in this example), then we’ll sort those by first name as well, ascending alphabetically. So to do this, we simply drag the LastName column followed by the FirstName column to the Sort box in the middle. In the sort box, order matters so LastName must be first.
Finally, generate a document and see what you have created. This step should be very familiar to you by now, but if not, please check out the Inserting a Tag tutorial.
You have completed this tutorial. We recommend taking a look at the SQL - Part 3: Filtering with Static Values tutorial next!